<template>
    <div>
        <a-drawer
            :open="open"
            :closable="false"
            :footer="null"
            width="420"
            :mask-closable="false"
            :body-style="bodyStyle"
            @cancel="onclose"
        >
            <div class="header">
                <div class="headerText">设置</div>
                <img class="settingHeaderLine" src="../assets/version2.0/settingHeaderLine.png" alt="">
            </div>
            <div class="main">
                <div class="content" ref="disk">
<!--                    <p style="font-size: 18px" ref="tttt">硬盘使用情况</p>-->
                    <!--        <a-progress :percent="diskUsage" :size="[300,20]"></a-progress>-->
<!--                    <div ref="disk"  ></div>-->
                </div>
                <div class="content" ref="ram">
<!--                    <p style="font-size: 18px">内存使用情况</p>-->
<!--                    <div ref="ram" ></div>-->
                </div>
                <div class="content"  style="height: 120px">
                    <p style="font-size: 16px;font-weight: 600;">CPU温度</p>
                    <div class="chart">
                        <a-progress :size="[85,5]" type="dashboard" :percent="(store.state.cpuTemperature).toFixed(1)" :format="percent => `${percent}℃`"></a-progress>
                    </div>
                </div>
                <div class="backDiv">
                    <BackButton ref="backButton" @click="onclose"></BackButton>
                </div>
            </div>

        </a-drawer>
    </div>

</template>

<script>
import axios from "axios";
import API_BASE_URL from "../../config.js";
import BackButton from "@/components/BackButton.vue";
import store from "@/store";

export default {
    name: "deviceInfo",
    computed: {
        store() {
            return store
        }
    },
    components: {BackButton},
    props: [],
    data() {
        return {
            open: false,
            bodyStyle: {
                position: 'relative',
                'justify-content': 'center',
                'align-items': 'center',
                'display': 'inline-block',
                'padding': '8px 0px 0px 0px'
            },
            allCapacity: 0,//硬盘总容量
            ramSize: 0,    //内存大小
            ramUsage: 0,
            usedCapacity: 0,
            diskUsage: 0,
            cpuTemperature: 0,

        }
    },
    methods: {
        onclose() {
            this.open = false
        },

    },
    mounted() {

    },
    created() {

    }
}
</script>

<style scoped>
.header{
    height: 40px;
    margin-bottom: 12px;
}
.headerText{
    display: flex;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}
.main{
    display: grid;
    gap: 24px;
}
.settingHeaderLine{
    height: 9px;
    width: 420px;
}
.main{
    width: 100%;
    height: 485px;
    padding: 0 10px;
}
.content {
    width: 400px;
    height: 160px;
    display: flex;
    align-items: center;
    gap: 62px;
}
.content p{
    font-size: 16px;
    font-weight: 600;
    background-color: #ffae00;
    color: white;
    padding: 4px 18px;
    border-radius: 20px;
    position: relative;
    top: -38px;
}

.backDiv {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    bottom: 20px;
    left: 32%;
}
.chart{
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    font-size: 16px;
}
</style>